import React, { useRef } from "react";

const Counter: React.FC = () => {
  let ref = useRef(0);

  function handleClick() {
    ref.current = ref.current + 1;
    alert("你点击了 " + ref.current + " 次");
  }

  return <button onClick={handleClick}>点击我！</button>;
};
export default Counter;
